Uploader = function(options){
	var _options = {};
	$.extend(_options,this._options,options);
	$.extend(this,{
		_options:_options
	});
	this._init();
};
Uploader.prototype= {
	_options:{
		url:"",
		type:".*",
		ctx:"/",
		button:"J_uploadify",
		progress:"J_uploadify_progress",
		href:"J_uploadify_href"
	},
	//----------------------------------------------------------------------------------------------//初始化
	_init:function(){
		$("#"+this._options.button).uploadify({
	        swf: this._options.ctx+"/assets/others/jquery/uploadify/uploadify.swf",
	        uploader : this._options.url,
	        fileObjName:"attachment",
	        queueID:this._options.progress,
	        fileTypeDesc:this._options.type+"文件",
	        fileTypeExts:this._options.type,
	        multi:false,
	        buttonText:"浏览",
	        progressData:"percentage",
	        onUploadError:$.proxy(this.error,this),
	        onSelectError:$.proxy(this.select,this),
	        onFallback:$.proxy(this.fallbak,this),
	        onUploadSuccess:$.proxy(this.success,this)
	    });
	},
	//----------------------------------------------------------------------------------------------//上传出错
	error:function(errorObj, file, code, msg, errorString){
		
	},
	//----------------------------------------------------------------------------------------------//上传成功
	success:function(file, data, response){
		var result =  JSON.parse(data);
		if(result.status=1){
			$("#"+this._options.href).attr("href",result.url).html(result.name);
		}
	},
	//----------------------------------------------------------------------------------------------//flash插件出错
	fallback:function(){
		
	},
	//----------------------------------------------------------------------------------------------//选择文件错误
	select:function(file, code, msg){
		
	}
};